<template>
  <el-dialog
    width="40rem"
    title="详细信息"
    :visible="dialogVisible"
    @close="$emit('close')"
  >
    <el-descriptions
      class="margin-top"
      :column="2"
      border
    >
      <el-descriptions-item
        v-for="(value,key) in data"
        :key="key"
      >
        <template slot="label">
          {{ key }}
        </template>
        {{ value }}
      </el-descriptions-item>
    </el-descriptions>
  </el-dialog>
</template>

<script>
export default {
  props: {
    dialogVisible: Boolean,
    detailData: Object
  },
  data() {
    return {
      data: {}
    }
  },
  watch: {
    dialogVisible: function(val) {
      if (val) {
        this.data['任务日期'] = this.detailData.mark
        this.data['标识'] = this.detailData.flag
        this.data['库名'] = this.detailData.dbName
        this.data['表名'] = this.detailData.dbTableName
        this.data['表数量'] = this.detailData.tableNumber
        this.data['hdfs数量'] = this.detailData.hdfsNumber
        this.data['冷备范围开始时间'] = this.detailData.cbRangeStartTime
        this.data['冷备范围结束时间'] = this.detailData.cbRangeEndTime
        this.data['开始时间'] = this.detailData.startTime
        this.data['结束时间'] = this.detailData.endTime
        this.data['状态'] = this.detailData.taskState
        this.data['任务阶段'] = this.detailData.taskStage
        this.data['冷备用时'] = this.detailData.cbTime
        this.data['副本保留'] = +this.detailData.replicaRetain ? '是' : '否'
        this.data['副本合并'] = +this.detailData.replicaMerge ? '是' : '否'
        this.data['Nas副本地址'] = this.detailData.nasReplicaPath
        this.data['全量数据保留地址'] = this.detailData.fullDataPath
        this.data['增量数据保留地址'] = this.detailData.increDataPath
        this.data['日志路径'] = this.detailData.logPath
        this.data['Nas盘名'] = this.detailData.nasName
      }
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
